<template>
  <div style="background:#fff;">
    <!-- <div class="header_warp">
      <img @click="goIndex" class="header_typeIcon" src="../assets/LOGO@3x.png" alt />
      <img @click="goIndex" class="header_storeIcon" src="../assets/LOGO@3x.png" alt />
      <div class="phone_warp" @click="goBack">
        <div v-if="userInfo">{{userInfo.mobile}}</div>
        <img class="ic_downFFF" src="../assets/ic_dowm.png" alt />
        <img class="ic_down333" src="../assets/xial.png" alt />
      </div>
      <div v-if="isBack" class="back" @click="goRegister">退出</div>
    </div> -->
   <div class="header_warp">
      <img class="header_typeIcon" @click="openTypeBtn" src="../assets/ic_type.png" alt />
      <img class="header_storeIcon" src="../assets/LOGO@3x.png" alt />
      <div class="phone_warp" @click="goBack">
        <div v-if="userInfo">{{userInfo.mobile}}</div>
        <img class="ic_downFFF" src="../assets/ic_dowm.png" alt />
        <img class="ic_down333" src="../assets/xial.png" alt />
      </div>
      <div v-if="isBack" class="back" @click="goRegister">退出</div>
    </div>

    <!-- <div class="header_warp">
      <img class="header_typeIcon" @click="openTypeBtn" src="../assets/ic_type.png" alt />
      <img class="header_storeIcon" src="../assets/LOGO@3x.png" alt />
      <div class="phone_warp" @click="goBack">
        <div v-if="userInfo">{{userInfo.mobile}}</div>
        <img class="ic_downFFF" src="../assets/ic_dowm.png" alt />
        <img class="ic_down333" src="../assets/xial.png" alt />
      </div>
      <div v-if="isBack" class="back" @click="goRegister">退出</div>
    </div> -->
    <div class="swiper">
      <swipe :autoplay="5000" indicator-color="#fff">
        <swipe-item v-for="(image, index) in SwiperImg" :key="index">
          <img :src="image.image" />
        </swipe-item>
      </swipe>
    </div>
    <!-- <div class="details_content" v-html="listItem.content"></div> -->
    <div class="details_title">{{listItem.title}}</div>
    <div class="details_bg">
      <div v-for="(item,index) in listItem.content " :key="index">
        <div class="contnet1">{{item.text}}</div>
        <div class="content_photo">
          <img :src="images" alt v-for="(images,index) in item.image" :key="index" />
        </div>
      </div>
    </div>
    <div class="footer" v-if="footerInfo">
      <div class="footer_phone">
        <div class="footer_phone_item">
          <img class="qq" src="../assets/ic_qq.png" alt />
          <div>
            <div>企业QQ：</div>
            <div>{{footerInfo.qq_company}}</div>
          </div>
        </div>
        <div class="footer_phone_item">
          <img class="qq" src="../assets/ic_phone.png" alt />
          <div>
            <div>合作电话：</div>
            <div>{{footerInfo.mobile_company}}</div>
          </div>
        </div>
        <div class="footer_phone_item">
          <img class="qq" src="../assets/ic_tel.png" alt />
          <div>
            <div>客服热线：</div>
            <div>{{footerInfo.online_company}}</div>
          </div>
        </div>
      </div>
      <div class="footer_content">
        <div>
          <div>全年服务热线： {{footerInfo.online_company}}</div>
          <div>E-mail：{{footerInfo.email_company}}</div>
          <div>公司地址：{{footerInfo.address_companey}}</div>
        </div>
        <img :src="'http://case.xzkj518.com'+footerInfo.wechat_company" alt />
      </div>
      <div class="guanzhu">关注我们</div>
      <div class="footer_footter">
        <div>{{footerInfo.comtent_company}}</div>
        <div>{{footerInfo.beian}}</div>
      </div>
    </div>
    <div class="mask" v-if="isMask"></div>
    <popup style="margin-top:35px;" v-model="isMask" position="top">
      <div class="popup_warp">
        <div class="popup_box">
          <div
            v-for="(item,index) in typeList"
            @click="chooseType(index,item.id)"
            :class="typeCss==index?'typeCss2':''"
            :key="index"
          >{{item.name}}</div>
        </div>
      </div>
    </popup>
  </div>
</template>
<script >
import { NavBar, Swipe, SwipeItem } from "vant";
import { Popup, Popover } from "vux";
import swiperText from "@/components/swiperText";
import * as API from "@/http/common/api";
export default {
  name: "detailss",
  data() {
    return {
      isBack: false,
      isMask: false,
      typeList: null,
      typeCss: 0,
      footerInfo: null, //
      SwiperImg: [],
      listItem: { content: "" },
      id: null,
      userInfo: null
    };
  },
  methods: {
    //类型选择
    chooseType(e, id) {

      console.log(e,id);
      this.typeCss = e;
      this.typeId = id;
      this.$store.dispatch("locTypeId", id);
      this.isMask=false;
       console.log("==============")
      this.$router.push({
        path:'/index',
        query:{
           typeId:id
        }
      })
    },
    // 分类
    CategoryList() {
      this.$http(API.CategoryList, {
        type: "GET",
        params: {}
      }).then(res => {
        this.$localStorage.set("typeList", JSON.stringify(res.data.data));
        this.typeList = res.data.data;
      });
    },
    //左上角 打开类型弹窗
    openTypeBtn() {
      this.isMask = !this.isMask;
    },
    goBack() {
      this.isBack = !this.isBack;
    },
    //去注册
    goRegister() {
      this.$router.push({ path: "/register" });
    },
    //
    goIndex() {
      this.$router.push({ path: "/index" });
    }, // footer信息
    websmsconf() {
      this.$http(API.websmsconf, {
        type: "GET",
        params: {
          // page: this.pageNum,
          // page_size: 1500,
          // category_id: this.$store.state.typeId, //分类id
          // search: this.searchInp //搜索内容
        }
      }).then(res => {
        this.footerInfo = res.data.data;
      });
    }
  },
  mounted() {
    console.log(this.$route);
    this.id = this.$route.query.item;
    this.userInfo = JSON.parse(this.$localStorage.get("userInfo"));
    this.$http(API.ProjectDetail, {
      type: "GET",
      params: {
        id: this.$route.query.item
      }
    }).then(res => {
      this.listItem = res.data.data;
    });
    this.$http(API.bannerList, {
      type: "GET",
      params: {}
    }).then(res => {
      this.SwiperImg = res.data.data;
    });
    this.CategoryList(); //分类
    this.websmsconf();
  },
  components: {
    Swipe,
    Popup,
    Popover,
    SwipeItem,
    swiperText
  }
};
</script>
<style scoped lang='less'>
.typeCss {
  color: #0076fe;
  border-bottom: #0076fe 3px solid;
}
.typeCss2 {
  border: #0076fe 2px solid !important;
  color: #0076fe !important;
}
.header_warp {
  display: flex;
  position: absolute;
  width: 100%;
  height: 70px;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0);
  color: #fff;
  z-index: 999999999;
  img {
    width: 46px;
    height: 40px;
  }
}
.swiper {
  width: 100%;
  height: 30%;
  position: relative;
  .van-swipe {
    width: 100%;
    height: 100%;
  }
  img {
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
}
.contnet1 {
  width: 670px;
  margin: 0 auto;
  padding: 20px 0;
  font-size: 24px;
  color: #666;
}
.content_photo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  img {
    width: 45%;
    margin: 10px;
  }
}
.phone_warp {
  display: flex;
  align-items: center;
  img {
    width: 20px;
    height: 20px;
    margin-top: 5px;
    margin-left: 10px;
  }
}
.back {
  position: absolute;
  width: 60px;
  height: 30px;
  color: #999;
  background: #fff;
  right: 00px;
  top: 60px;
  text-align: center;
  line-height: 30px;
  border-radius: 4px;
  border: 2px solid #eee;
}
// .header_typeIcon {
//   width: 150px !important;
//   height: 40px !important;
// }
.header_storeIcon {
  width: 156px !important;
  height: 40px !important;
  margin-left: 20px;
}
.details_content {
  font-size: 15px;
  padding: 30px;
  box-sizing: border-box;
  width: 100%;
  p {
    padding: 0 !important;
  }
}
.details_title {
  background: rgb(245, 246, 253);
  text-align: center;
  color: #333;
  font-size: 32px;
  padding: 60px 0 40px 0;
}

.details_bg {
  background: rgb(245, 246, 253);
  padding-bottom: 50px;
}
.footer {
  background: #242424;
  color: #fff;
  box-sizing: border-box;
  padding-top: 66px;
  .footer_phone {
    font-size: 18px;

    display: flex;
    align-items: center;
    justify-content: center;
    width: 70%;
    margin: 0 auto;
    box-sizing: border-box;
    justify-content: space-between;
    .footer_phone_item {
      display: flex;

      align-items: center;
      img {
        width: 72px;
        height: 72px;
        margin-right: 26px;
      }
    }
  }
  .footer_content {
    width: 70%;
    margin: 0 auto;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    margin-top: 45px;
    div {
      div {
        line-height: 40px;
      }
    }
    img {
      width: 146px;
      height: 146px;
    }
  }
  .guanzhu {
    text-align: right;
    width: 70%;
    margin: 0 auto;
    box-sizing: border-box;
    margin-top: 10px;
    margin-bottom: 25px;
    padding-right: 40px;
  }
  .footer_footter {
    display: flex;
    box-sizing: border-box;
    justify-content: center;
    border-top: #666 solid 2px;
    padding-top: 40px;
    padding-bottom: 40px;
    div {
      margin: 0 20px;
      text-align: center;
    }
  }
}
.mask {
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99;
  left: 0;
  top: 0;
}
.popup_box {
  background: #fff;
  display: flex;
  // padding-top:81px;
  flex-wrap: wrap;
  padding: 20px 0 20px 20px;
  box-sizing: border-box;
  div {
    width: 132px;
    height: 56px;
    margin: 10px 20px;
    line-height: 56px;
    font-size: 28px;
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box;
    border: solid 2px #999;
    color: #999;
  }
}
</style>
    